import java.util.Scanner;

public class main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        float a = in.nextFloat();
        char b = in.next().charAt(0);

        int ret = 0;
        if(a <= 1) {
            ret = 20;
        }else {
            ret = 20 + (int)Math.ceil(a - 1);
            // float tmp = a - 1;
            // if(tmp - (int)tmp > 0) ret = 20 + (int)tmp + 1;
            // else ret = 20 + (int)tmp;
        }

        if(b == 'y') ret += 5;

        System.out.println(ret);
    }
}